{% extends "stocksys/base/base_page.html" %}
{% load staticfiles %}
{% block content %}
    <div class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="card">
                        <div class="content">
                            <h4 class="title">{{ title }}</h4>
                            <div class="toolbar">
                            </div>
                            <div class="material-datatables">
                                <table id="datatables" class="table table-striped table-no-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th class="disabled-sorting text-center">行业</th>
                                        <th class="disabled-sorting text-center">代码</th>
                                        <td class="text-center">涨跌幅</td>
                                        <td class="text-center">涨跌额</td>
                                        <td class="text-center">成交量（万）</td>
                                        <td class="text-center">成交额（万）</td>
                                        <td class="text-center">当前价</td>
                                        <td class="text-center">昨收</td>
                                        <td class="text-center">今开</td>
                                        <th class="disabled-sorting text-center">行情</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for conceptual in conceptuals %}
                                        <tr class="{{ conceptual.color }}">
                                            <td class="text-center"><a
                                                    href="{% url 'stocksys:concept_stock' id=conceptual.id %}">{{ conceptual.name }}</a>
                                            </td>
                                            <td class="text-center">{{ conceptual.code }}</td>
                                            {# TODO: 加入预测策略#}
                                            <td class="text-center">{{ conceptual.chg | floatformat:3 }}</td>
                                            <td class="text-center">{{ conceptual.chg_price | floatformat:3 }}</td>
                                            <td class="text-center">{{ conceptual.volume | floatformat:3 }}</td>
                                            <td class="text-center">{{ conceptual.money | floatformat:3 }}</td>
                                            <td class="text-center">{{ conceptual.current | floatformat:3 }}</td>
                                            <td class="text-center">{{ conceptual.close | floatformat:3 }}</td>
                                            <td class="text-center">{{ conceptual.open | floatformat:3 }}</td>
                                            <td class="text-center">
{#                                                <a href="{% url 'stocksys:quant_rule_predict' addr=conceptual.conceptual_address.id code=conceptual.code start_date=quant_start_date end_date=quant_end_date conceptual_type=predict_type %}">查看行情</a>#}
                                            </td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <!-- end content-->
                    </div>
                    <!--  end card  -->
                </div>
                <!-- end col-md-12 -->
            </div>
        </div>
    </div>
{% endblock %}
{% block pagescript %}
    <script type="text/javascript">
        $(document).ready(function () {
            $('#datatables').DataTable({
                "pagingType": "full_numbers",
                "lengthMenu": [
                    [25],
                    [25]
                ],
                responsive: true,
                language: {
                    search: "_INPUT_",
                    searchPlaceholder: "检索关键字",
                }
            });
            var table = $('#datatables').DataTable();
            $('.card .material-datatables label').addClass('form-group');
        });
    </script>
{% endblock %}

